package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        //id:唯一标识  唯一标识：该值可以唯一标识一个信息 特点：非空且唯一
        long id = main.getId();
        System.out.println("id:"+id);
        //名字
        String name = main.getName();
        System.out.println("name:"+name);
        //线程优先级
        int priority = main.getPriority();
        System.out.println("优先级："+priority);
        boolean isAlive = main.isAlive();
        System.out.println("是否还活着："+isAlive);
        boolean isDaemon = main.isDaemon();
        System.out.println("是否为守护线程："+isDaemon); //true
        boolean isInterrupted = main.isInterrupted(); //false
        System.out.println("手否被中断："+isInterrupted); //false
    }
}
